package com.yj.web;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yj.entity.Details;
import com.yj.service.IDetailsService;
import com.yj.vo.JsonResult;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author yj
 * @since 2020-08-24
 */
@RestController
@RequestMapping("/users/details")
public class DetailsController {

	@Autowired
	IDetailsService details;
	
	//查询该用户的所有订单
	@PostMapping("/getdetails")
	public JsonResult getAllDetails(int puid) {
		return details.finAllDetail(puid);
	}
	
	//新增订单
	@PostMapping("/adddetails")
	public JsonResult addDetails(Details detail) {
		return details.addDetail(detail);
	}
	
}
